package ijij41.togetherTrain.participate;

import android.content.Intent;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import ijij41.togetherTrain.common.AbstractTrainListActivity;
import ijij41.togetherTrain.resource.TrainListRow;

public class TrainListParticipateActivity extends
		AbstractTrainListActivity {

	@Override
	protected void publicOnItemClick(AdapterView<?> arg0, View arg1,
			int position, long arg3) {
		Log.v("TRAIN", "TrainListActivity : pos " + position);

		Intent roomListIntent = new Intent(
				TrainListParticipateActivity.this, RoomListActivity.class);

		// //// send parameters
		TrainListRow trainListRow = (TrainListRow) arg0.getAdapter().getItem(
				position);

		Intent intent = getIntent();
		String date = intent.getStringExtra("date");

		roomListIntent.putExtra("date", date);
		roomListIntent.putExtra("trainNum", trainListRow.getTrainNum());
		roomListIntent.putExtra("startTime", trainListRow.getStartTime());
		roomListIntent.putExtra("startStation", trainListRow.getStartStation());
		roomListIntent.putExtra("endtTime", trainListRow.getEndTime());
		roomListIntent.putExtra("endStation", trainListRow.getEndStation());
		// ///////////////////

		startActivity(roomListIntent);

	}

}
